{extend name="member/common/login_layout" /}

{block name="content"}

<div class="nc-login-layout">
  <div class="openid"><span class="avatar"><img src="<?php echo $headimgurl;?>" /></span><span>您使用微信账号<a href="#register_form"><?php echo $user_info['nickname']; ?></a>注册成功，系统为您随机新建商城用户名及密码，请牢记或自行修改；也可<a style="color:red"  href="index.php">跳过该步骤</a>直接登录。</span></div>
  <div class="left-pic"><img src="__MEMBER_PATH__/images/login_openid.jpg" /> </div>
  <div class="nc-login">
    <div class="arrow"></div>
    <div class="nc-wx-mode">
      <ul class="tabs-nav">
        <li><a href="#register">完善账号信息<i></i></a></li>
      </ul>
      <div id="tabs_container" class="tabs-container">
        <div id="register" class="tabs-content">
          <form name="register_form" id="register_form" class="nc-login-form" method="post" action="{:url('member/Connectwx/edit_info')}">
            <input type="hidden" value="ok" name="form_submit">
            <dl>
              <dt>用户名：</dt>
              <dd>
                <input type="text" value="<?php echo $user_info['nickname']; ?>" id="user" name="user" class="text" readOnly/>
              </dd>
            </dl>
            <dl>
              <dt>设置密码：</dt>
              <dd>
                <input type="text" value="<?php echo $password;?>" id="password" name="password" class="text" tipMsg="6-20个大小写英文字母、符号或数字"/>
              </dd>
            </dl>
            <!--<dl class="mt15">
              <dt>邮箱：</dt>
              <dd>
                <input type="text" id="email" name="email" class="text" tipMsg="输入常用邮箱作为验证及找回密码使用"/>
              </dd>
            </dl>-->
            <div class="submit-div">
              <input type="submit" name="submit" value="确认提交" class="submit"/>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
$(function(){
	//初始化Input的灰色提示信息  
	$('input[tipMsg]').inputTipText();
	//登录方式切换
	$('.nc-wx-mode').tabulous({
		 effect: 'flip'//动画反转效果
	});
    //注册表单验证
        $('#register_form').validate({
            errorPlacement: function(error, element){
            var error_td = element.parent('dd');
            error_td.append(error);
            element.parents('dl:first').addClass('error');
        },
        success: function(label) {
            label.parents('dl:first').removeClass('error').find('label').remove();
        },
            rules: {
                password: {
                    required: true,
                    minlength: 6,
                    maxlength: 20
                },
                email: {
                    required: true,
                    email: true,
                    remote: {
                        url: '{:url("member/Login/check_email")}',
                        type: 'get',
                        data: {
                            email: function() {
                                return $('#email').val();
                            }
                        }
                    }
                }
        },
        messages : {
            password  : {
                required : '<i class="icon-exclamation-sign"></i>密码不能为空',
                minlength: '<i class="icon-exclamation-sign"></i>密码长度应在6-20个字符之间',
				maxlength: '<i class="icon-exclamation-sign"></i>密码长度应在6-20个字符之间'
            },
//            email : {
//                required : '<i class="icon-exclamation-sign"></i>电子邮箱不能为空',
//                email    : '<i class="icon-exclamation-sign"></i>这不是一个有效的电子邮箱',
//				remote	 : '<i class="icon-exclamation-sign"></i>该电子邮箱已经存在'
//            }
        }
    });
});
</script>

{/block}